import json
from openpyxl import Workbook
 
# 打开并读取JSON文件
with open('douyin_data.json') as file:
    json_data= json.load(file)
capacitySetList = json_data['data']['CapacitySetList']

wb = Workbook()
ws = wb.active
for capacitySet in capacitySetList:
    name = capacitySet['Name']
    intro = capacitySet['Introduction']
    categorys = capacitySet['CategoryList']
    appTypes = capacitySet['AppTypeCfgList']
    appTyps =','.join( [appType['Value'] for appType in appTypes])
    for category in categorys:
        categoryValue = category['Value']
        rows = [name,intro,categoryValue,appTyps]
        ws.append(rows)

wb.save('douyin_data.xlsx')